package com.example.demo.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.domain.User;
import com.example.demo.service.IUserService;

@RestController
public class UserController {

    @Autowired
    private IUserService userService;

    @RequestMapping("/list")
    public List<User> list() {
    	
    	
    	userService.queryAllPerms(2l);
    	try {
			userService.addUser(1);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        return null;
    }
    @RequestMapping("/listall")
    public List<String> listall() {
		/*
		 * CglibAopProxy cc=new CglibAopProxy(); DynamicAdvisedInterceptor ss=new
		 * DynamicAdvisedInterceptor();
		 */
    	userService.queryAllPerms(2l);
    	 
        return userService.queryAllPerms(2l);
    }
}
